-- GENERATED SPELL FOR [Grel'borg the Miser] --


function spell0_2417(pUnit, Event) --@Bloodlust,n/a--
pUnit:FullCastSpellOnTarget(6742,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2417', 30349, 1)
end

function spell1_2417(pUnit, Event) --@Quick Flame Ward,n/a--
pUnit:FullCastSpellOnTarget(4979,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2417', 11500, 1)
end

function spell2_2417(pUnit, Event) --@Rain of Fire,n/a--
pUnit:FullCastSpellOnTarget(11990,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2417', 9000, 1)
end

function Sorts_2417(pUnit, Event)
local choix_sorts_2417 = math.random(0, 2)
if choix_sorts_2417 == 0 then
pUnit:RegisterEvent('spell0_2417', 1, 1)
end
if choix_sorts_2417 == 1 then
pUnit:RegisterEvent('spell1_2417', 1, 1)
end
if choix_sorts_2417 == 2 then
pUnit:RegisterEvent('spell2_2417', 1, 1)
end
end

function mob2417_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_2417', math.random(1500, 3000), 1)
end

function mob2417_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2417_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2417_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(2417, 1, 'mob2417_Action')
RegisterUnitEvent(2417, 2, 'mob2417_Leave')
RegisterUnitEvent(2417, 3, 'mob2417_Kill')
RegisterUnitEvent(2417, 4, 'mob2417_Die')
